package org.smr.ministore.service;

import org.smr.ministore.entities.Goods;
import org.blade.service.base.BaseService;
import org.blade.service.base.BaseBatchService;
import org.blade.service.base.PaginationQueryService;
import org.smr.ministore.entities.GoodsOrgan;
import org.smr.ministore.entities.vo.Assign2OrganVO;
import org.smr.ministore.entities.vo.Assign2OrgansVO;
import org.smr.ministore.entities.vo.OrganVO;

import java.util.List;

/**
 * @author blade
 */
public interface GoodsService extends BaseService<Long, Goods>,
        BaseBatchService<Long, Goods>,
        PaginationQueryService<Long, Goods> {

    /**
     * 根据业务主键查询
     *
     * @param goods Goods 商品
     * @return Goods
     */
    Goods queryByPrimaryKey(Goods goods);

    /**
     * 指派给组织
     *
     * @param assignee 受派人
     * @return 影响的行数
     */
    int assign(Assign2OrgansVO assignee);

    /**
     * 逻辑删除
     * @param id
     * @return 影响的行数
     */
    int deleteByIdLogical(Long id);

    /**
     * 多个商品指派给组织
     *
     * @param goodsAssign2Organ 商品集合指派给组织
     * @return 影响的行数
     */
    int assign(Assign2OrganVO goodsAssign2Organ);


    /**
     * 查询商品已经指派的组织
     * @param assignee 查询条件
     * @return List<GoodsOrgan>
     */
    List<GoodsOrgan> queryGoodsAssignee(Assign2OrgansVO assignee);

}
